package com.lzx.adx.report.util.helper;

import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.URLUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.lzs.adx.commmon.utils.JsonUtils;
import com.lzx.adx.report.dto.AccountDTO;
import com.lzx.adx.report.dto.ReportDTO;
import com.lzx.adx.report.model.aqy.AqyRequest;
import com.lzx.adx.report.model.baidu.BaiduRequest;
import com.lzx.adx.report.model.common.CommonReportRequest;
import com.lzx.adx.report.model.dm.DmRequest;
import com.lzx.adx.report.model.huawei.request.HwReportRequest;
import com.lzx.adx.report.model.ks.request.KsReportRequest;
import com.lzx.adx.report.model.proxy.ProxyReq;
import com.lzx.adx.report.model.qtt.QttRequest;
import com.lzx.adx.report.model.wifi.WifiRequest;
import com.lzx.adx.report.model.xiaomi.XiaoMiRequest;
import com.lzx.adx.report.model.youyou.YouYouRequest;
import com.lzx.adx.report.util.URLEncoderDecoderTool;
import com.lzx.adx.report.util.UrlUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;

@Slf4j
public class KkHeper {


    public static String covertXykkUrl(ReportDTO reportDTO,AccountDTO accountDTO) {
        ProxyReq proxyReq=JSONObject.parseObject(reportDTO.getExtend(),ProxyReq.class);
        Map<String,Object> params=new HashMap<>();
        params.put("adGroupld",proxyReq.getAdgroupId());
        params.put("campaignld",proxyReq.getCampaignId());
        params.put("creativeld",proxyReq.getContentId());
        if(StringUtils.isNotBlank(proxyReq.getOaidSum()) && !proxyReq.getOaidSum().equals("d41d8cd98f00b204e9800998ecf8427e")) {
            params.put("oaidSum", proxyReq.getOaidSum());
        }
        params.put("oaid",proxyReq.getOaid());
        params.put("imei", proxyReq.getImei());
        params.put("ua", StringUtils.isNotBlank(proxyReq.getUserAgent())?URLUtil.encode(proxyReq.getUserAgent()):"");
        params.put("ip",proxyReq.getIp());
        params.put("os","android");
        params.put("time",proxyReq.getTraceTime());
        if(StringUtils.isNotBlank(proxyReq.getUnionSite()) && !proxyReq.getUnionSite().contains("__")){
            params.put("unionSite",proxyReq.getUnionSite());
        }
        if(StringUtils.isNotBlank(proxyReq.getCsite()) && !proxyReq.getCsite().contains("__")){
            params.put("csite",proxyReq.getCsite());
        }


        String callbackUrl=String.format(accountDTO.getDspCallbackUrl(),reportDTO.getBizRequestId());

        String urlParams= UrlUtil.covertParamsOrderByAsc(params)+"&callbackUrl="+URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportClickUrl()+"&"+urlParams;
    }


    public static String covertKskkUrl(AccountDTO accountDTO, ReportDTO reportDTO, KsReportRequest ksReportRequest) {
        Map<String,Object> params=new HashMap<>();
        params.put("adGroupld",ksReportRequest.getAdgroup_id());
        params.put("campaignld",ksReportRequest.getCampaign_id());
        params.put("creativeld",ksReportRequest.getContent_id());
        params.put("oaidSum",ksReportRequest.getOaidSum());
        if(StringUtils.isNotBlank(ksReportRequest.getOaid())&& !ksReportRequest.getOaid().equals("__")) {
            params.put("oaid", ksReportRequest.getOaid());
        }
        params.put("imeiSum", ksReportRequest.getImei());
        params.put("ua", StringUtils.isNotBlank(ksReportRequest.getUser_agent())?URLUtil.encode(ksReportRequest.getUser_agent()):"");
        params.put("ip",ksReportRequest.getIp());
        params.put("os","android");
        params.put("time",ksReportRequest.getTrace_time());

        String callbackUrl=String.format(accountDTO.getDspCallbackUrl(),reportDTO.getBizRequestId());

        String urlParams= UrlUtil.covertParamsOrderByAsc(params)+"&callbackUrl="+URLEncoderDecoderTool.encodeURL(callbackUrl);

        String ul=accountDTO.getDspReportClickUrl()+"&"+urlParams;
        if(ul.contains("__CSITE__")){
            ul = ul.replace("__CSITE__", ksReportRequest.getCsite());
        }
        if(ul.contains("__POS__")){
            ul = ul.replace("__POS__", ksReportRequest.getPos());
        }

        return ul;
    }


    public static String covertWifiKKUrl(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String,Object> params=new HashMap<>();

        params.put("adGroupld",reportDTO.getAdgroupId());
        params.put("campaignld",reportDTO.getCampaignId());
        params.put("creativeld",reportDTO.getContentId());
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid())?reportDTO.getOaid():"");
        params.put("oaidSum","");
        if(StringUtils.isNotBlank(reportDTO.getImei()) && !reportDTO.getImei().contains("__")) {
            params.put("imei", reportDTO.getImei());
        }

        if(StringUtils.isNotBlank(reportDTO.getImeiSum()) && !reportDTO.getImeiSum().contains("__")) {
            params.put("imeiSum", reportDTO.getImeiSum());
        }

        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent())?URLUtil.encode(reportDTO.getUser_agent()):"");
        params.put("ip",reportDTO.getIp());
        params.put("os","android");
        params.put("time",System.currentTimeMillis());

        String callbackUrl=String.format(accountDTO.getDspCallbackUrl(),reportDTO.getBizRequestId());

        String urlParams= UrlUtil.covertParamsOrderByAsc(params)+"&callbackUrl="+URLEncoderDecoderTool.encodeURL(callbackUrl);
        if(reportDTO.getEventType().equals("click")){
            return accountDTO.getDspReportClickUrl()+"&"+urlParams;
        }else{
            return accountDTO.getDspReportImpUrl()+"&"+urlParams;
        }
    }

    public static String covertUrl(AccountDTO accountDTO, CommonReportRequest aqyRequest, ReportDTO reportDTO) {
        Map<String,Object> params=new HashMap<>();
        params.put("adGroupld",aqyRequest.getAdgroupId());
        params.put("campaignld",aqyRequest.getCampaignId());
        params.put("creativeld",aqyRequest.getContentId());
        params.put("oaid", StringUtils.isNotBlank(aqyRequest.getOaid())?aqyRequest.getOaid():"");
        params.put("oaidSum","");
        if(StringUtils.isNotBlank(aqyRequest.getImei()) && !aqyRequest.getImei().equals("__IMEI__")) {
            params.put("imeiSum", aqyRequest.getImei());
        }else{
            params.put("imeiSum","");
        }
        params.put("imei","");
        params.put("ua", StringUtils.isNotBlank(aqyRequest.getUser_agent())?URLUtil.encode(aqyRequest.getUser_agent()):"");
        params.put("ip",aqyRequest.getIp());
        params.put("os","android");
        params.put("time",aqyRequest.getTraceTime());

        String callbackUrl=String.format(accountDTO.getDspCallbackUrl(),reportDTO.getBizRequestId());

        String urlParams= UrlUtil.covertParamsOrderByAsc(params)+"&callbackUrl="+URLEncoderDecoderTool.encodeURL(callbackUrl);
        if(aqyRequest.getEventType().equals("click")){
            return accountDTO.getDspReportClickUrl()+"&"+urlParams;
        }else{
            return accountDTO.getDspReportImpUrl()+"&"+urlParams;
        }
    }

    public static String covertChuangZhiUrl(AccountDTO accountDTO, CommonReportRequest aqyRequest, ReportDTO reportDTO) {
        Map<String,Object> params=new HashMap<>();
        params.put("imeimd5",aqyRequest.getImei());
        params.put("oaid",aqyRequest.getOaid());

        params.put("android_id",aqyRequest.getHash_android_id());
        params.put("ip",aqyRequest.getIp());
        params.put("user_agent",URLUtil.encode(aqyRequest.getUser_agent()));
        params.put("srequest_id", reportDTO.getBizRequestId());

        String callbackUrl=String.format(accountDTO.getDspCallbackUrl(),reportDTO.getBizRequestId());

        String urlParams= URLUtil.buildQuery(params, StandardCharsets.UTF_8)+"&callback="+URLEncoderDecoderTool.encodeURL(callbackUrl);

        return accountDTO.getDspReportUrl()+"&"+urlParams;
    }


    public static String covertChuangZhiUrl(AccountDTO accountDTO, QttRequest qttRequest, ReportDTO reportDTO) {
        Map<String,Object> params=new HashMap<>();
        params.put("imeimd5",qttRequest.getImei());
        params.put("oaid",qttRequest.getOaid());
        params.put("oaidmd5",qttRequest.getOaidMd5());
        params.put("android_id","");
        params.put("mac","");
        params.put("imei","");
        params.put("ip",qttRequest.getIp());
        params.put("user_agent",URLUtil.encode(qttRequest.getUser_agent()));
        params.put("srequest_id", reportDTO.getBizRequestId());
        String callbackUrl=String.format(accountDTO.getDspCallbackUrl(),reportDTO.getBizRequestId());
        String urlParams= URLUtil.buildQuery(params, StandardCharsets.UTF_8)+"&callback="+URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl()+"&"+urlParams;
    }


    public static String covertAllChuangZhiUrl(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String,Object> params=new HashMap<>();
        params.put("imeimd5",StringUtils.isNotBlank(reportDTO.getImeiSum()) ? reportDTO.getImeiSum() : "");
        params.put("oaid",StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        params.put("oaidmd5",StringUtils.isNotBlank(reportDTO.getOaidSum()) ? reportDTO.getOaidSum() : "");
        params.put("android_id",StringUtils.isNotBlank(reportDTO.getHash_android_id()) ? reportDTO.getHash_android_id() : "");
        params.put("mac","");
        params.put("imei",StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei() : "");
        params.put("ip",StringUtils.isNotBlank(reportDTO.getIp()) ? reportDTO.getIp() : "");
        params.put("user_agent",StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("srequest_id", reportDTO.getBizRequestId());
        String callbackUrl=String.format(accountDTO.getDspCallbackUrl(),reportDTO.getBizRequestId());
        String urlParams= URLUtil.buildQuery(params, StandardCharsets.UTF_8)+"&callback="+URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl()+"&"+urlParams;
    }

    public static String covertChuangZhiUrl(AccountDTO accountDTO, HwReportRequest hwReportRequest, ReportDTO reportDTO) {



        Map<String,Object> params=new HashMap<>();
        params.put("imeimd5","");
        params.put("oaid",hwReportRequest.getOaid());

        params.put("android_id","");
        params.put("ip",hwReportRequest.getIp());
        params.put("user_agent",URLUtil.encode(hwReportRequest.getUser_agent()));
        params.put("srequest_id", reportDTO.getBizRequestId());

        String callbackUrl=String.format(accountDTO.getDspCallbackUrl(),reportDTO.getBizRequestId());

        String urlParams= URLUtil.buildQuery(params, StandardCharsets.UTF_8)+"&callback="+URLEncoderDecoderTool.encodeURL(callbackUrl);

        return accountDTO.getDspReportUrl()+"&"+urlParams;
    }


    /**
     *  转换58同城数据
     * @param accountDTO 账户数据
     * @param WBRequest  58同城
     * @param reportDTO
     *
     * @return
     */
    public static String covertWBUrl(AccountDTO accountDTO, QttRequest WBRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", WBRequest.getIp());
        params.put("ua", URLUtil.encode(WBRequest.getUser_agent()));
        params.put("os", "android");
        params.put("ts", WBRequest.getTsms());
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("oaid", StringUtils.isNotBlank(WBRequest.getOaid()) ? WBRequest.getOaid() : "");
        params.put("oaid_md5", StringUtils.isNotBlank(WBRequest.getOaidMd5()) ? WBRequest.getOaidMd5() : "");
        params.put("imei", StringUtils.isNotBlank(WBRequest.getImei()) ? WBRequest.getImei() : "");
        params.put("aid", "44625");
        params.put("sid", "314520");
        params.put("redirect", "false");
        params.put("conv_ext", "Ego1MTIwNjY3NjMxGAEgAirGA2h0dHBzOi8vYWR2ZXJ0LjU4LmNvbS93YW5neWk_Y29udj1fX2NvbnZfXyZkZXZpY2U9X19kZXZpY2VfaWRfXyZpbWVpPV9faW1laV9fJmFuZHJvaWRfaWQ9X19hbmRyb2lkX2lkX18mb2FpZD1fX29haWRfXyZvYWlkX21kNT1fX29haWRfbWQ1X18maWRmYT1fX2lkZmFfXyZpZGZhX21kNT1fX2lkZmFfbWQ1X18mY2FpZD1fX2NhaWRfXyZjYWlkX21kNT1fX2NhaWRfbWQ1X18mYWFpZD1fX2FhaWRfXyZyZXE9X19yZXFfaWRfXyZzcG9uc29yPV9fc3BvbnNvcl9pZF9fJmNhbXBhaWduPV9fY2FtcGFpZ25faWRfXyZncm91cD1fX2dyb3VwX2lkX18mY29udGVudD1fX2NvbnRlbnRfaWRfXyZkZXZlbG9wZXI9X19kZXZlbG9wZXJfaWRfXyZhcHA9X19hcHBfaWRfXyZpcD1fX2lwX18mdWE9X191YV9fJm1hYz1fX21hY19fJm1hYzE9X19tYWMxX18mb3M9X19vc19fJm1vZGVsPV9fbW9kZWxfXyZ0cz1fX3RzX18yOmh0dHA6Ly9hcGkud2lyZWxlc3MuNTguY29tL2FwaS9yZWRpcmVjdC9kb3duLzEzNjY_cGlkPTEzNjY6FgjR3AJYmJkTYJT_R2id7okDcJe6mgw");
        log.info("回传给58同城的原始数据：{}", JsonUtils.toJsonString(params));
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;

    }

    public static String covertQttYdUrl(AccountDTO accountDTO, QttRequest WBRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", WBRequest.getIp());
        params.put("ua", URLUtil.encode(WBRequest.getUser_agent()));
        params.put("os", "android");
        params.put("ts", WBRequest.getTsms());
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("developer_id", "9bc124de24e2416c");
        params.put("oaid", StringUtils.isNotBlank(WBRequest.getOaid()) ? WBRequest.getOaid() : "");
        params.put("oaid_md5", StringUtils.isNotBlank(WBRequest.getOaidMd5()) ? WBRequest.getOaidMd5() : "");
        params.put("imei", StringUtils.isNotBlank(WBRequest.getImei()) ? WBRequest.getImei() : "");
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;

    }

    /**
     *  转换58同城数据
     * @param accountDTO 账户数据
     * @param HmjcRequest  盒马剧场
     * @param reportDTO
     *
     * @return
     */
    public static String covertHmjcUrl(AccountDTO accountDTO, QttRequest HmjcRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", HmjcRequest.getIp());
        params.put("ua", StringUtils.isNotBlank(HmjcRequest.getUser_agent()) ? URLUtil.encode(HmjcRequest.getUser_agent()) : "");
        params.put("os", "android");
        params.put("ts", HmjcRequest.getTsms());
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("oaid", StringUtils.isNotBlank(HmjcRequest.getOaid()) ? HmjcRequest.getOaid() : "");
        params.put("oaid_md5", StringUtils.isNotBlank(HmjcRequest.getOaidMd5()) ? HmjcRequest.getOaidMd5() : "");
        params.put("imei", StringUtils.isNotBlank(HmjcRequest.getImei()) ? HmjcRequest.getImei() : "");
        params.put("aid", "45101");
        params.put("sid", "315324");
        params.put("redirect", "false");
        params.put("conv_ext", "Ego2MDYyMTQ5MTU1GAEgAiqgBGh0dHBzOi8vbW9uaXRvci56cWlkcy5jb20vZ2xvcnktYWR2ZXJ0L2FkLzEwMTcvMzA_Y29udj1fX2NvbnZfXyZkZXZpY2VfaWQ9X19kZXZpY2VfaWRfXyZpbWVpPV9faW1laV9fJmFuZHJvaWRfaWQ9X19hbmRyb2lkX2lkX18mb2FpZD1fX29haWRfXyZvYWlkX21kNT1fX29haWRfbWQ1X18mY2FpZD1fX2NhaWRfXyZjYWlkX21kNT1fX2NhaWRfbWQ1X18mYWFpZD1fX2FhaWRfXyZyZXFfaWQ9X19yZXFfaWRfXyZzcG9uc29yX2lkPV9fc3BvbnNvcl9pZF9fJmFjY2lkPV9fY2FtcGFpZ25faWRfXyZwaWQ9X19ncm91cF9pZF9fJmNpZD1fX2NvbnRlbnRfaWRfXyZkZXZlbG9wZXJfaWQ9X19kZXZlbG9wZXJfaWRfXyZhcHBfaWQ9X19hcHBfaWRfXyZpcD1fX2lwX18mdWE9X191YV9fJm1hYz1fX21hY19fJm1hYzE9X19tYWMxX18mb3M9X19vc19fJm1vZGVsPV9fbW9kZWxfXyZ0cz1fX3RzX18maXNOZXdWZXJzaW9uPTAmcG5hbWU9Y29tLmR6LmhtamMmY2hhbm5lbENvZGU9SE1URkZPWDEwMDAwNDQmYm9va0lkPTQxMDAwMTAyODE3JmNoYXB0ZXJJZD01NjgxMjcyMjAyswFodHRwczovL2t5eS1kbC5kemhyZWFkLmNuL2R6LWRvd24tcGsvYmFzZS9kb3duUGsvZG93bi5hcGs_cGtuYT1jb20uZHouaG1qYyZjaGFubmVsQ29kZT1ITVRGRk9YMTAwMDA0NCZib29rSWQ9NDEwMDAxMDI4MTcmY2hhcHRlcklkPTU2ODEyNzIyMCZ0b2tlbj1kZjNkODQzYzdmZTQ3ZDYzN2FmZGE2NzYwYWZlMmQwMjoWCK3gAli8nxNgkYdIaP_9iQNw2NiaDA");
        log.info("趣头条回传给盒马剧场的原始数据：{}", JsonUtils.toJsonString(params));
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "?" + urlParams;

    }


    /**
     *  转换58同城数据
     * @param accountDTO 账户数据
     * @param HmjcRequest  盒马剧场
     * @param reportDTO
     *
     * @return
     */
    public static String covertTanTanUrl(AccountDTO accountDTO, QttRequest HmjcRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", HmjcRequest.getIp());
        params.put("ua", StringUtils.isNotBlank(HmjcRequest.getUser_agent()) ? URLUtil.encode(HmjcRequest.getUser_agent()) : "");
        params.put("os", "android");
        params.put("ts", HmjcRequest.getTsms());
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("oaid", StringUtils.isNotBlank(HmjcRequest.getOaid()) ? HmjcRequest.getOaid() : "");
        params.put("oaid_md5", StringUtils.isNotBlank(HmjcRequest.getOaidMd5()) ? HmjcRequest.getOaidMd5() : "");
        params.put("imei", StringUtils.isNotBlank(HmjcRequest.getImei()) ? HmjcRequest.getImei() : "");
        params.put("aid", "43633");
        params.put("sid", "313922");
        params.put("redirect", "false");
        params.put("conv_ext", "Ego0Nzg1NjU4MzM2GAEgAiqcA2h0dHBzOi8vYWZmaWxpYXRlLnRhbnRhbmFwcC5jb20vYWRzL3dhbmd5aXlvdWRhby9odWFqaW4tNTA_Y29udj1fX2NvbnZfXyZkZXZpY2VfaWQ9X19kZXZpY2VfaWRfXyZpbWVpPV9faW1laV9fJmFuZHJvaWRfaWQ9X19hbmRyb2lkX2lkX18mb2FpZD1fX29haWRfXyZpZGZhPV9faWRmYV9fJmNhaWQ9X19jYWlkX18mcmVxX2lkPV9fcmVxX2lkX18mc3BvbnNvcl9pZD1fX3Nwb25zb3JfaWRfXyZjYW1wYWlnbl9pZD1fX2NhbXBhaWduX2lkX18mZ3JvdXBfaWQ9X19ncm91cF9pZF9fJmNvbnRlbnRfaWQ9X19jb250ZW50X2lkX18mZGV2ZWxvcGVyX2lkPV9fZGV2ZWxvcGVyX2lkX18mYXBwX2lkPV9fYXBwX2lkX18maXA9X19pcF9fJm9zPV9fb3NfXyZtYWM9X19tYWNfXyZtYWMxPV9fbWFjMV9fJnVhPV9fdWFfXyZ0cz1fX3RzX18yNWh0dHBzOi8vdGFudGFuYXBwLmNvbS90YW50YW5fV2FuZ3lpeW91ZGFvSHVhamluNTAuYXBrOhYI8dQCWMKUE2Co9kdopt2JA3DGnJoM");
        log.info("趣头条回传给探探的原始数据：{}", JsonUtils.toJsonString(params));
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;

    }


    public static String covertGjwUrl(AccountDTO accountDTO, QttRequest WBRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", WBRequest.getIp());
        params.put("ua", URLUtil.encode(WBRequest.getUser_agent()));
        params.put("os", "android");
        params.put("ts", WBRequest.getTsms());
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("oaid", StringUtils.isNotBlank(WBRequest.getOaid()) ? WBRequest.getOaid() : "");
        params.put("oaid_md5", StringUtils.isNotBlank(WBRequest.getOaidMd5()) ? WBRequest.getOaidMd5() : "");
        params.put("imei", StringUtils.isNotBlank(WBRequest.getImei()) ? WBRequest.getImei() : "");
        params.put("aid", "43870");
        params.put("sid", "314528");
        params.put("redirect", "false");
        params.put("conv_ext", "Ego1OTQ0NzkxNDY2GAEgAirMA2h0dHBzOi8vYWR2ZXJ0LjU4LmNvbS93YW5neWkvZ2Fuamk_Y29udj1fX2NvbnZfXyZkZXZpY2U9X19kZXZpY2VfaWRfXyZpbWVpPV9faW1laV9fJmFuZHJvaWRfaWQ9X19hbmRyb2lkX2lkX18mb2FpZD1fX29haWRfXyZvYWlkX21kNT1fX29haWRfbWQ1X18maWRmYT1fX2lkZmFfXyZpZGZhX21kNT1fX2lkZmFfbWQ1X18mY2FpZD1fX2NhaWRfXyZjYWlkX21kNT1fX2NhaWRfbWQ1X18mYWFpZD1fX2FhaWRfXyZyZXE9X19yZXFfaWRfXyZzcG9uc29yPV9fc3BvbnNvcl9pZF9fJmNhbXBhaWduPV9fY2FtcGFpZ25faWRfXyZncm91cD1fX2dyb3VwX2lkX18mY29udGVudD1fX2NvbnRlbnRfaWRfXyZkZXZlbG9wZXI9X19kZXZlbG9wZXJfaWRfXyZhcHA9X19hcHBfaWRfXyZpcD1fX2lwX18mdWE9X191YV9fJm1hYz1fX21hY19fJm1hYzE9X19tYWMxX18mb3M9X19vc19fJm1vZGVsPV9fbW9kZWxfXyZ0cz1fX3RzX18yR2h0dHBzOi8vZGwuNThjZG4uY29tLmNuL2JhbmdiYW5nL2dhbmppLzEwLjE4LjU1L2dhbmppXzY0NjFfYXJtNjR2OGEuYXBrOhYI3tYCWKCZE2Dj-Edo6eGJA3D7o5oM");
        log.info("回传给赶集网的原始数据：{}", JsonUtils.toJsonString(params));
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;

    }


    /**
     *  转换58同城数据
     * @param accountDTO 账户数据
     * @param HmjcRequest  盒马剧场
     * @param reportDTO
     *
     * @return
     */
    public static String covertBaiduHmjcUrl(AccountDTO accountDTO, BaiduRequest HmjcRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", HmjcRequest.getIp());
        params.put("ua", StringUtils.isNotBlank(HmjcRequest.getUser_agent()) ? URLUtil.encode(HmjcRequest.getUser_agent()) : "");
        params.put("os", "android");
        params.put("ts", System.currentTimeMillis());
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("oaid", StringUtils.isNotBlank(HmjcRequest.getOaid()) ? HmjcRequest.getOaid() : "");
        params.put("oaid_md5", StringUtils.isNotBlank(HmjcRequest.getOaidMd5()) ? HmjcRequest.getOaidMd5() : "");
        params.put("imei", StringUtils.isNotBlank(HmjcRequest.getImei()) ? HmjcRequest.getImei().toUpperCase() : "");
        params.put("aid", "45101");
        params.put("sid", "315324");
        params.put("redirect", "false");
        params.put("conv_ext", "Ego2MDYyMTQ5MTU1GAEgAiqgBGh0dHBzOi8vbW9uaXRvci56cWlkcy5jb20vZ2xvcnktYWR2ZXJ0L2FkLzEwMTcvMzA_Y29udj1fX2NvbnZfXyZkZXZpY2VfaWQ9X19kZXZpY2VfaWRfXyZpbWVpPV9faW1laV9fJmFuZHJvaWRfaWQ9X19hbmRyb2lkX2lkX18mb2FpZD1fX29haWRfXyZvYWlkX21kNT1fX29haWRfbWQ1X18mY2FpZD1fX2NhaWRfXyZjYWlkX21kNT1fX2NhaWRfbWQ1X18mYWFpZD1fX2FhaWRfXyZyZXFfaWQ9X19yZXFfaWRfXyZzcG9uc29yX2lkPV9fc3BvbnNvcl9pZF9fJmFjY2lkPV9fY2FtcGFpZ25faWRfXyZwaWQ9X19ncm91cF9pZF9fJmNpZD1fX2NvbnRlbnRfaWRfXyZkZXZlbG9wZXJfaWQ9X19kZXZlbG9wZXJfaWRfXyZhcHBfaWQ9X19hcHBfaWRfXyZpcD1fX2lwX18mdWE9X191YV9fJm1hYz1fX21hY19fJm1hYzE9X19tYWMxX18mb3M9X19vc19fJm1vZGVsPV9fbW9kZWxfXyZ0cz1fX3RzX18maXNOZXdWZXJzaW9uPTAmcG5hbWU9Y29tLmR6LmhtamMmY2hhbm5lbENvZGU9SE1URkZPWDEwMDAwNDQmYm9va0lkPTQxMDAwMTAyODE3JmNoYXB0ZXJJZD01NjgxMjcyMjAyswFodHRwczovL2t5eS1kbC5kemhyZWFkLmNuL2R6LWRvd24tcGsvYmFzZS9kb3duUGsvZG93bi5hcGs_cGtuYT1jb20uZHouaG1qYyZjaGFubmVsQ29kZT1ITVRGRk9YMTAwMDA0NCZib29rSWQ9NDEwMDAxMDI4MTcmY2hhcHRlcklkPTU2ODEyNzIyMCZ0b2tlbj1kZjNkODQzYzdmZTQ3ZDYzN2FmZGE2NzYwYWZlMmQwMjoWCK3gAli8nxNgkYdIaP_9iQNw2NiaDA");
        log.info("百度回传给盒马剧场的原始数据：{}", JsonUtils.toJsonString(params));
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;

    }

    public static String covertBaiduYouDaoUrl(AccountDTO accountDTO, BaiduRequest HmjcRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", HmjcRequest.getIp());
        params.put("ua", StringUtils.isNotBlank(HmjcRequest.getUser_agent()) ? URLUtil.encode(HmjcRequest.getUser_agent()) : "");
        params.put("os", "android");
        params.put("ts", System.currentTimeMillis());
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("developer_id", "9bc124de24e2416c");
        params.put("oaid", StringUtils.isNotBlank(HmjcRequest.getOaid()) ? HmjcRequest.getOaid() : "");
        params.put("oaid_md5", StringUtils.isNotBlank(HmjcRequest.getOaidMd5()) ? HmjcRequest.getOaidMd5() : "");
        params.put("imei", StringUtils.isNotBlank(HmjcRequest.getImei()) ? HmjcRequest.getImei().toUpperCase() : "");
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;

    }




    public static String covertHonorKk(AccountDTO accountDTO, CommonReportRequest aqyRequest, ReportDTO reportDTO) {
        String sspExtend = accountDTO.getSspExtend();
        JSONObject jsonObject = JSONObject.parseObject(sspExtend);
        Map<String,Object> params=new HashMap<>();
        params.put("ch",jsonObject.get("ch"));
        params.put("adGroupld",aqyRequest.getAdgroupId());
        params.put("campaignld",aqyRequest.getCampaignId());
        params.put("creativeld",aqyRequest.getContentId());
        params.put("unionSite",jsonObject.get("unionSite"));
        params.put("targetPkg",jsonObject.get("targetPkg"));
        params.put("oaid", StringUtils.isNotBlank(aqyRequest.getOaid())?aqyRequest.getOaid():"");
        params.put("oaidSum","");
        params.put("imeiSum","");
        params.put("imei","");
        params.put("ua", URLUtil.encode(aqyRequest.getUser_agent()));
        params.put("ip",aqyRequest.getIp());
        params.put("os","android");
        params.put("time",aqyRequest.getTraceTime());
        String callbackUrl=String.format(accountDTO.getDspCallbackUrl(),reportDTO.getBizRequestId());
        String urlParams= URLUtil.buildQuery(params, StandardCharsets.UTF_8)+"&callbackUrl="+URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportClickUrl()+"&"+urlParams;
    }


    public static String covertYYKk(AccountDTO accountDTO, YouYouRequest youYouRequest, ReportDTO reportDTO) {
        String sspExtend = accountDTO.getSspExtend();
        JSONObject jsonObject = JSONObject.parseObject(sspExtend);
        Map<String, Object> params = new HashMap<>();
        params.put("ch", jsonObject.get("ch"));
        params.put("adGroupld", youYouRequest.getAdgroupId());
        params.put("campaignld", youYouRequest.getCampaignId());
        params.put("creativeld", youYouRequest.getContentId());
        params.put("unionSite", jsonObject.get("unionSite"));
        params.put("targetPkg", jsonObject.get("targetPkg"));
        params.put("oaid", StringUtils.isNotBlank(youYouRequest.getOaid()) ? youYouRequest.getOaid() : "");
        params.put("oaidSum", StringUtils.isNotBlank(youYouRequest.getOaidMd5()) ? youYouRequest.getOaid().toLowerCase() : "");
        params.put("imeiSum", StringUtils.isNotBlank(youYouRequest.getImeiMd5()) ? youYouRequest.getImeiMd5().toLowerCase() : "");
        params.put("imei", StringUtils.isNotBlank(youYouRequest.getImei()) ? youYouRequest.getImei() : "");
        params.put("ua", StringUtils.isNotBlank(youYouRequest.getUa()) ? URLUtil.encode(youYouRequest.getUa()) : "");
        params.put("ip", youYouRequest.getIp());
        params.put("os", "android");
        params.put("time", youYouRequest.getTimestamp());
        String callbackUrl=String.format(accountDTO.getDspCallbackUrl(),reportDTO.getBizRequestId());
        String urlParams= URLUtil.buildQuery(params, StandardCharsets.UTF_8)+"&callbackUrl="+URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportClickUrl()+"&"+urlParams;
    }



    public static String covertYYJy(AccountDTO accountDTO, YouYouRequest youYouRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("account_id", "");
        params.put("campaignId", "");
        params.put("unitId", "");
        params.put("oaid", StringUtils.isNotBlank(youYouRequest.getOaid()) ? youYouRequest.getOaid() : "");
        params.put("imei", StringUtils.isNotBlank(youYouRequest.getImeiMd5()) ? youYouRequest.getImeiMd5() : "");
        params.put("ua", StringUtils.isNotBlank(youYouRequest.getUa()) ? URLUtil.encode(youYouRequest.getUa()) : "");
        params.put("ip", youYouRequest.getIp());
        params.put("os", "android");
        String callbackUrl=String.format(accountDTO.getDspCallbackUrl(),reportDTO.getBizRequestId());
        String urlParams= URLUtil.buildQuery(params, StandardCharsets.UTF_8)+"&callback="+URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl()+urlParams;
    }


    public static String covertDmKk(AccountDTO accountDTO, DmRequest dmRequest, ReportDTO reportDTO) {
        String sspExtend = accountDTO.getSspExtend();
        JSONObject jsonObject = JSONObject.parseObject(sspExtend);
        Map<String,Object> params=new HashMap<>();
        params.put("ch",jsonObject.get("ch"));
        params.put("adGroupld",dmRequest.getAdgroupId());
        params.put("campaignld",dmRequest.getCampaignId());
        params.put("creativeld",dmRequest.getContentId());
        params.put("unionSite",jsonObject.get("unionSite"));
        params.put("targetPkg",jsonObject.get("targetPkg"));
        params.put("oaid", StringUtils.isNotBlank(dmRequest.getOaid())?dmRequest.getOaid():"");
        params.put("oaidSum", StringUtils.isNotBlank(dmRequest.getOaidMd5()) ? dmRequest.getOaid().toLowerCase() : "");
        params.put("imeiSum",StringUtils.isNotBlank(dmRequest.getImeiMd5()) ? dmRequest.getImeiMd5().toLowerCase() : "");
        params.put("imei",StringUtils.isNotBlank(dmRequest.getImei())?dmRequest.getImei():"");
        params.put("ua", URLUtil.encode(dmRequest.getUser_agent()));
        params.put("ip",dmRequest.getIp());
        params.put("os","android");
        params.put("time",System.currentTimeMillis());
        String callbackUrl=String.format(accountDTO.getDspCallbackUrl(),reportDTO.getBizRequestId());
        String urlParams= URLUtil.buildQuery(params, StandardCharsets.UTF_8)+"&callbackUrl="+URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportClickUrl()+"&"+urlParams;
    }





    public static String covertOppoKk(AccountDTO accountDTO, CommonReportRequest aqyRequest, ReportDTO reportDTO) {
        String sspExtend = accountDTO.getSspExtend();
        JSONObject jsonObject = JSONObject.parseObject(sspExtend);
        Map<String, Object> params = new HashMap<>();
        params.put("ch", jsonObject.get("ch"));
        params.put("adGroupld", aqyRequest.getAdgroupId());
        params.put("campaignld", aqyRequest.getCampaignId());
        params.put("creativeld", aqyRequest.getContentId());
        params.put("unionSite", jsonObject.get("unionSite"));
        params.put("targetPkg", jsonObject.get("targetPkg"));
        params.put("oaid", StringUtils.isNotBlank(aqyRequest.getOaid()) ? aqyRequest.getOaid() : "");
        params.put("oaidSum", "");
        params.put("imeiSum", StringUtils.isNotBlank(aqyRequest.getImei()) ? aqyRequest.getImei() : "");
        params.put("imei", "");
        params.put("ua", StringUtils.isNotBlank(aqyRequest.getUser_agent()) ? URLUtil.encode(aqyRequest.getUser_agent()) : "");
        params.put("ip", aqyRequest.getIp());
        params.put("os", "android");
        params.put("time", aqyRequest.getTraceTime());
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callbackUrl=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportClickUrl() + "&" + urlParams;
    }




    public static String covertWYUrl(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("adGroupld", reportDTO.getAdgroupId());
        params.put("campaignld", reportDTO.getCampaignId());
        params.put("creativeld", reportDTO.getContentId());
        params.put("oaidSum", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid().toLowerCase() : "");
        params.put("imeiSum", reportDTO.getImei());
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("ip", reportDTO.getIp());
        params.put("os", "android");
        params.put("time", System.currentTimeMillis());
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callbackUrl=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportClickUrl() + "&" + urlParams;
    }


    public static String covertHwKk(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("adGroupld", reportDTO.getAdgroupId());
        params.put("campaignld", reportDTO.getCampaignId());
        params.put("creativeld", reportDTO.getContentId());
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        params.put("oaidSum", StringUtils.isNotBlank(reportDTO.getOaidSum()) ? reportDTO.getOaidSum() : "");
        params.put("imeiSum", StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei() : "");
        params.put("imei", "");
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("ip", reportDTO.getIp());
        params.put("os", "android");
        params.put("time", System.currentTimeMillis());
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callbackUrl=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportClickUrl() + "&" + urlParams;
    }




    public static String covertYeYu(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        //国际移动设备标识符 明⽂imei或者md5加密imei (会根据⻓度判断等于32时为md5加密后的值) 能获取到，则必填
        params.put("imei", StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei() : "");
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("ip", StringUtils.isNotBlank(reportDTO.getIp()) ? reportDTO.getIp() : "");
        params.put("os", "android");
        params.put("clickid", reportDTO.getBizRequestId());
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;
    }



    public static String covertTtUrl(AccountDTO accountDTO, WifiRequest WBRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", WBRequest.getIp());
        params.put("ua", URLUtil.encode(WBRequest.getUser_agent()));
        params.put("os", "android");
        params.put("ts", String.valueOf(System.currentTimeMillis()));
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("oaid", StringUtils.isNotBlank(WBRequest.getOaid()) ? WBRequest.getOaid() : "");
        params.put("oaid_md5", StringUtils.isNotBlank(WBRequest.getHashOaid()) ? WBRequest.getHashOaid() : "");
        params.put("imei", StringUtils.isNotBlank(WBRequest.getImei()) ? WBRequest.getImei() : "");
        params.put("aid", "43633");
        params.put("sid", "313922");
        params.put("redirect", "false");
        params.put("conv_ext", "Ego0Nzg1NjU4MzM2GAEgAiqcA2h0dHBzOi8vYWZmaWxpYXRlLnRhbnRhbmFwcC5jb20vYWRzL3dhbmd5aXlvdWRhby9odWFqaW4tNTA_Y29udj1fX2NvbnZfXyZkZXZpY2VfaWQ9X19kZXZpY2VfaWRfXyZpbWVpPV9faW1laV9fJmFuZHJvaWRfaWQ9X19hbmRyb2lkX2lkX18mb2FpZD1fX29haWRfXyZpZGZhPV9faWRmYV9fJmNhaWQ9X19jYWlkX18mcmVxX2lkPV9fcmVxX2lkX18mc3BvbnNvcl9pZD1fX3Nwb25zb3JfaWRfXyZjYW1wYWlnbl9pZD1fX2NhbXBhaWduX2lkX18mZ3JvdXBfaWQ9X19ncm91cF9pZF9fJmNvbnRlbnRfaWQ9X19jb250ZW50X2lkX18mZGV2ZWxvcGVyX2lkPV9fZGV2ZWxvcGVyX2lkX18mYXBwX2lkPV9fYXBwX2lkX18maXA9X19pcF9fJm9zPV9fb3NfXyZtYWM9X19tYWNfXyZtYWMxPV9fbWFjMV9fJnVhPV9fdWFfXyZ0cz1fX3RzX18yNWh0dHBzOi8vdGFudGFuYXBwLmNvbS90YW50YW5fV2FuZ3lpeW91ZGFvSHVhamluNTAuYXBrOhYI8dQCWMKUE2Co9kdopt2JA3DGnJoM");
        log.info("回传给探探的原始数据：{}", JsonUtils.toJsonString(params));
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;


    }



    public static String covertYdUrl(AccountDTO accountDTO, WifiRequest WBRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", WBRequest.getIp());
        params.put("ua", URLUtil.encode(WBRequest.getUser_agent()));
        params.put("os", "android");
        params.put("ts", String.valueOf(System.currentTimeMillis()));
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("developer_id", "9bc124de24e2416c");
        params.put("oaid", StringUtils.isNotBlank(WBRequest.getOaid()) ? WBRequest.getOaid() : "");
        params.put("oaid_md5", StringUtils.isNotBlank(WBRequest.getHashOaid()) ? WBRequest.getHashOaid() : "");
        params.put("imei", StringUtils.isNotBlank(WBRequest.getImei()) ? WBRequest.getImei() : "");
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;


    }






    public static String covertBaiduKk(AccountDTO accountDTO, BaiduRequest baiduRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("adGroupld", reportDTO.getAdgroupId());
        params.put("campaignld", reportDTO.getCampaignId());
        params.put("creativeld", reportDTO.getContentId());
        params.put("oaid", reportDTO.getOaid());
        params.put("oaidSum", baiduRequest.getOaidMd5());
        params.put("imeiSum", baiduRequest.getImei());
        params.put("imei", "");
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("ip", reportDTO.getIp());
        params.put("os", "android");
        params.put("time", reportDTO.getTraceTime());
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callbackUrl=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportClickUrl() + "&" + urlParams;
    }










    public static String covertYYUrl(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", reportDTO.getIp());
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ?URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("os", "android");
        params.put("ts", String.valueOf(System.currentTimeMillis()));
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        if (StringUtils.isNotBlank(reportDTO.getOaid())){
            params.put("oaid_md5", SecureUtil.md5(reportDTO.getOaid()));
        }
        params.put("imei", StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei() : "");
        params.put("aid", "33894");
        params.put("sid", "314340");
        params.put("redirect", "false");
        params.put("conv_ext", "Ego0OTc5ODkxODYyGAEgAiqnA2h0dHBzOi8vcHVzaC5iaWdkYS5jb20vcHVzaC5kbz9oaWlkb2VpZD0zNjI0JmlkPTExMjQ4MjkmcHJvZHVjdF9pZD0xNzEmYWRmcm9tPXdhbmd5aSZjb252PV9fY29udl9fJmRldmljZV9pZD1fX2RldmljZV9pZF9fJmltZWk9X19pbWVpX18mYW5kcm9pZGlkPV9fYW5kcm9pZF9pZF9fJm9haWQ9X19vYWlkX18maWRmYT1fX2lkZmFfXyZyZXFfaWQ9X19yZXFfaWRfXyZzcG9uc29yX2lkPV9fc3BvbnNvcl9pZF9fJmNhbXBhaWduX2lkPV9fY2FtcGFpZ25faWRfXyZncm91cF9pZD1fX2dyb3VwX2lkX18mY29udGVudF9pZD1fX2NvbnRlbnRfaWRfXyZkZXZlbG9wZXJfaWQ9X19kZXZlbG9wZXJfaWRfXyZhcHBfaWQ9X19hcHBfaWRfXyZpcD1fX2lwX18mdWE9X191YV9fJm1hYz1fX21hY19fJm9zPV9fb3NfXyZ0cz1fX3RzX18maW1wcmVzc3R5cGU9NDJaIGh0dHBzOi8veXlkbC55eS5jb20vbW9iaWxlL3l5bW9iaWxlX2NsaWVudC1hbmRyb2lkLzguMjUuMS95eW1vYmlsZV9jbGllbnQtOC4yNS4xLTc4NzkuYXBrOhYI5ogCWOSXE2CW8UZoqsOHA3DEjJYM");
        log.info("回传给YY的原始数据：{}", JsonUtils.toJsonString(params));
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;


    }


    public static String covertXiaomiYDUrl(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", reportDTO.getIp());
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ?URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("os", "android");
        params.put("ts", String.valueOf(System.currentTimeMillis()));
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("developer_id", "9bc124de24e2416c");
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        if (StringUtils.isNotBlank(reportDTO.getOaid())){
            params.put("oaid_md5", SecureUtil.md5(reportDTO.getOaid()));
        }
        params.put("imei", StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei() : "");
        log.info("回传给有道的原始数据：{}", JsonUtils.toJsonString(params));
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;


    }





    public static String covertYouYouYDUrl(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", reportDTO.getIp());
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ?URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("os", "android");
        params.put("ts", String.valueOf(System.currentTimeMillis()));
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("developer_id", "9bc124de24e2416c");
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        if (StringUtils.isNotBlank(reportDTO.getOaid())){
            params.put("oaid_md5", SecureUtil.md5(reportDTO.getOaid()));
        }
        params.put("imei", StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei() : "");
        log.info("回传给有道的原始数据：{}", JsonUtils.toJsonString(params));
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;


    }

    public static String covertAllYDUrl(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", reportDTO.getIp());
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ?URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("os", "android");
        params.put("ts", String.valueOf(System.currentTimeMillis()));
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("developer_id", "9bc124de24e2416c");
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        params.put("oaid_md5", StringUtils.isNotBlank(reportDTO.getOaidSum()) ? reportDTO.getOaidSum() : "");
        //这里是MD5大写的
        params.put("imei", StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei().toUpperCase() : "");
        log.info("回传给有道的原始数据：{}", JsonUtils.toJsonString(params));
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;


    }


    public static String covertHuiChuanYDUrl(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", reportDTO.getIp());
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ?URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("os", "android");
        params.put("ts", String.valueOf(System.currentTimeMillis()));
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("developer_id", "9bc124de24e2416c");
        params.put("android_id_md5", StringUtils.isNotBlank(reportDTO.getHash_android_id()) ? reportDTO.getHash_android_id() : "");
        params.put("reqid", "");
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        params.put("oaid_md5", StringUtils.isNotBlank(reportDTO.getOaidSum()) ? reportDTO.getOaidSum() : "");
        params.put("imei", StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei().toUpperCase() : "");
        log.info("回传给有道的原始数据：{}", JsonUtils.toJsonString(params));
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;


    }


    public static String covertHaiBeiYDUrl(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", reportDTO.getIp());
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ?URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("os", "android");
        params.put("ts", String.valueOf(System.currentTimeMillis()));
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", StringUtils.isNotBlank(reportDTO.getHash_android_id()) ? reportDTO.getHash_android_id() : "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("developer_id", "9bc124de24e2416c");
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        params.put("oaid_md5", StringUtils.isNotBlank(reportDTO.getOaidSum()) ? reportDTO.getOaidSum() : "");
        params.put("imei", StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei() : "");
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;


    }


    /**
     * 通用创智
     * @param accountDTO
     * @param reportDTO
     * @return
     */
    public static String covertChuangZhiUrl(AccountDTO accountDTO,ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("imeimd5", reportDTO.getImei());
        params.put("oaidmd5", reportDTO.getOaid());
        params.put("android_id", reportDTO.getHash_android_id());
        params.put("ip", reportDTO.getIp());
        params.put("user_agent", StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("srequest_id", reportDTO.getBizRequestId());
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;
    }










    public static String covertQttJgUrl(AccountDTO accountDTO, QttRequest WBRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", StringUtils.isNotBlank(reportDTO.getIp()) ? reportDTO.getIp() : "");
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("android_id", StringUtils.isNotBlank(reportDTO.getHash_android_id()) ? reportDTO.getHash_android_id() : "");
        params.put("oaid", StringUtils.isNotBlank(WBRequest.getOaid()) ? WBRequest.getOaid() : "");
        params.put("oaidMD5", StringUtils.isNotBlank(WBRequest.getOaidMd5()) ? WBRequest.getOaidMd5() : "");
        params.put("imeiMD5", StringUtils.isNotBlank(WBRequest.getImei()) ? WBRequest.getImei() : "");
        log.info("回传给聚告(腾讯视频)同城的原始数据：{}", JsonUtils.toJsonString(params));
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + urlParams;

    }


    public static String covertHwYYUrl(AccountDTO accountDTO, HwReportRequest hwReportRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", reportDTO.getIp());
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("os", "android");
        params.put("ts", System.currentTimeMillis());
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        params.put("oaid_md5", "");
        params.put("imei", "");
        params.put("aid", "33894");
        params.put("sid", "314340");
        params.put("redirect", "false");
        params.put("conv_ext", "Ego0OTc5ODkxODYyGAEgAiqnA2h0dHBzOi8vcHVzaC5iaWdkYS5jb20vcHVzaC5kbz9oaWlkb2VpZD0zNjI0JmlkPTExMjQ4MjkmcHJvZHVjdF9pZD0xNzEmYWRmcm9tPXdhbmd5aSZjb252PV9fY29udl9fJmRldmljZV9pZD1fX2RldmljZV9pZF9fJmltZWk9X19pbWVpX18mYW5kcm9pZGlkPV9fYW5kcm9pZF9pZF9fJm9haWQ9X19vYWlkX18maWRmYT1fX2lkZmFfXyZyZXFfaWQ9X19yZXFfaWRfXyZzcG9uc29yX2lkPV9fc3BvbnNvcl9pZF9fJmNhbXBhaWduX2lkPV9fY2FtcGFpZ25faWRfXyZncm91cF9pZD1fX2dyb3VwX2lkX18mY29udGVudF9pZD1fX2NvbnRlbnRfaWRfXyZkZXZlbG9wZXJfaWQ9X19kZXZlbG9wZXJfaWRfXyZhcHBfaWQ9X19hcHBfaWRfXyZpcD1fX2lwX18mdWE9X191YV9fJm1hYz1fX21hY19fJm9zPV9fb3NfXyZ0cz1fX3RzX18maW1wcmVzc3R5cGU9NDJaIGh0dHBzOi8veXlkbC55eS5jb20vbW9iaWxlL3l5bW9iaWxlX2NsaWVudC1hbmRyb2lkLzguMjUuMS95eW1vYmlsZV9jbGllbnQtOC4yNS4xLTc4NzkuYXBrOhYI5ogCWOSXE2CW8UZoqsOHA3DEjJYM");
        log.info("华为回传给yy的原始数据：{}", JsonUtils.toJsonString(params));
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "?" + urlParams;

    }

    public static String covertHwYdXhsUrl(AccountDTO accountDTO, HwReportRequest hwReportRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", reportDTO.getIp());
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("os", "android");
        params.put("ts", System.currentTimeMillis());
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        params.put("oaid_md5", "");
        params.put("imei", "");
        params.put("aid", "37576");
        params.put("sid", "313744");
        params.put("redirect", "false");
        params.put("developer_id", "9bc124de24e2416c");
        params.put("conv_ext", "Ego1MzI2MDA1NTAzGAEgAiq5A2h0dHBzOi8vd3d3LnhpYW9ob25nc2h1LmNvbS9hcGkvc25zL3YxL2V4dC9hZHMvQ1BBLTNEU1AtTjctU1pHRy9jbGtfY29sbGVjdD90c19tcz1fX3RzX18mY2xpY2tfaWQ9X19yZXFfaWRfXyZjYWxsYmFja191cmw9X19jYWxsYmFja191cmxfXyZhY2NvdW50X2lkPV9fc3BvbnNvcl9pZF9fJmNhbXBhaWduX2lkPV9fY2FtcGFpZ25faWRfXyZhZGdyb3VwX2lkPV9fZ3JvdXBfaWRfXyZhZF9pZD1fX2NvbnRlbnRfaWRfXyZwbGF0Zm9ybT1fX29zX18maWRmYT1fX2lkZmFfXyZpZGZhX3N1bT1fX2lkZmFfbWQ1X18maW1laV9zdW09X19pbWVpX18mb2FpZD1fX29haWRfXyZvYWlkX3N1bT1fX29haWRfbWQ1X18mbWFjX3N1bT1fX21hY19fJm1hYzFfc3VtPV9fbWFjMV9fJmFuZHJvaWRfaWRfc3VtPV9fYW5kcm9pZF9pZF9fJmlwPV9faXBfXyZ1YT1fX3VhX18mY29udj1fX2NvbnZfXzJQaHR0cHM6Ly93d3cueGlhb2hvbmdzaHUuY29tL2FwaS9zbnMvdjEvZXh0L2Fkcy9keW5hbWljL0NQQS0zRFNQLU43LVNaR0ctbGl0ZS5hcGs6FgjIpQJYkJMTYID1RmjGuogDcNz8lww");
        log.info("华为回传给有道小红书的原始数据：{}", JsonUtils.toJsonString(params));
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;

    }



    public static String covertHwYdUrl(AccountDTO accountDTO, HwReportRequest hwReportRequest, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", reportDTO.getIp());
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("os", "android");
        params.put("ts", System.currentTimeMillis());
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        params.put("developer_id", "9bc124de24e2416c");
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        params.put("oaid_md5", "");
        params.put("imei", "");
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;

    }






    public static String covertAqyYdUrl(AccountDTO accountDTO,ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", reportDTO.getIp());
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("os", "android");
        params.put("ts", reportDTO.getTraceTime());
        params.put("model", "");
        params.put("idfa", "");
        params.put("idfa_md5", "");
        params.put("caid_idfa", "");
        params.put("caid", "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", "");
        params.put("reqid", "");
        if (StringUtils.isNotBlank(reportDTO.getOaid())){
            params.put("oaid", reportDTO.getOaid());
            params.put("oaid_md5", SecureUtil.md5(reportDTO.getOaid()));
        }
        params.put("imei", StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei() : "");
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;

    }



    public static String covertXiaomiJgUrl(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", StringUtils.isNotBlank(reportDTO.getIp()) ? reportDTO.getIp() : "");
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("android_id", StringUtils.isNotBlank(reportDTO.getHash_android_id()) ? reportDTO.getHash_android_id() : "");
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        params.put("oaidMD5", StringUtils.isNotBlank(reportDTO.getOaid()) ? SecureUtil.md5(reportDTO.getOaid()) : "");
        params.put("imeiMD5", StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei() : "");
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + urlParams;

    }





    public static String covertKsJgUrl(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", StringUtils.isNotBlank(reportDTO.getIp()) ? reportDTO.getIp() : "");
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("android_id", StringUtils.isNotBlank(reportDTO.getHash_android_id()) ? reportDTO.getHash_android_id() : "");
        params.put("oaidMD5", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        params.put("imeiMD5", StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei() : "");
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + urlParams;

    }

    public static String covertAllJgUrl(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", StringUtils.isNotBlank(reportDTO.getIp()) ? reportDTO.getIp() : "");
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("android_id", StringUtils.isNotBlank(reportDTO.getHash_android_id()) ? reportDTO.getHash_android_id() : "");
        params.put("imei", StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei() : "");
        params.put("imeiMD5", StringUtils.isNotBlank(reportDTO.getImeiSum()) ? reportDTO.getImeiSum() : "");
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        params.put("oaidMD5", StringUtils.isNotBlank(reportDTO.getOaidSum()) ? reportDTO.getOaidSum() : "");
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + urlParams;

    }


    public static String covertAllNewJgUrl(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", StringUtils.isNotBlank(reportDTO.getIp()) ? reportDTO.getIp() : "");
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("android_id", StringUtils.isNotBlank(reportDTO.getHash_android_id()) ? reportDTO.getHash_android_id() : "");
        params.put("imei", StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei() : "");
        params.put("imei_md5", StringUtils.isNotBlank(reportDTO.getImeiSum()) ? reportDTO.getImeiSum() : "");
        params.put("oaid", StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        params.put("oaid_md5", StringUtils.isNotBlank(reportDTO.getOaidSum()) ? reportDTO.getOaidSum() : "");
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + urlParams;

    }




    public static String covertSoulYouDaoIosUrl(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String, Object> params = new HashMap<>();
        params.put("ip", reportDTO.getIp());
        params.put("ua", StringUtils.isNotBlank(reportDTO.getUser_agent()) ?URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("os", "ios");
        params.put("ts", String.valueOf(System.currentTimeMillis()));
        params.put("model", "");
        params.put("idfa", StringUtils.isNotBlank(reportDTO.getIdfa()) ?reportDTO.getIdfa() : "");
        params.put("idfa_md5", StringUtils.isNotBlank(reportDTO.getIdfaSum()) ?reportDTO.getIdfaSum() : "");
        params.put("caid_idfa", "");
        params.put("caid", StringUtils.isNotBlank(reportDTO.getOaid()) ?reportDTO.getOaid() : "");
        params.put("aaid", "");
        params.put("android_id", "");
        params.put("android_id_md5", StringUtils.isNotBlank(reportDTO.getHash_android_id()) ?reportDTO.getHash_android_id() : "");
        params.put("reqid", "");
        params.put("oaid", "");
        params.put("oaid_md5", "");
        params.put("developer_id", "9bc124de24e2416c");
        params.put("imei", "");
        String callbackUrl = String.format(accountDTO.getDspCallbackUrl(), reportDTO.getBizRequestId());
        String urlParams = URLUtil.buildQuery(params, StandardCharsets.UTF_8) + "&callback=" + URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl() + "&" + urlParams;


    }

    public static String covertCz(AccountDTO accountDTO, ReportDTO reportDTO) {
        Map<String,Object> params=new HashMap<>();
        params.put("imeimd5",StringUtils.isNotBlank(reportDTO.getImeiSum()) ? reportDTO.getImeiSum() : "");
        params.put("oaid",StringUtils.isNotBlank(reportDTO.getOaid()) ? reportDTO.getOaid() : "");
        params.put("oaidmd5",StringUtils.isNotBlank(reportDTO.getOaidSum()) ? reportDTO.getOaidSum() : "");
        params.put("android_id",StringUtils.isNotBlank(reportDTO.getHash_android_id()) ? reportDTO.getHash_android_id() : "");
        params.put("mac","");
        params.put("imei",StringUtils.isNotBlank(reportDTO.getImei()) ? reportDTO.getImei() : "");
        params.put("ip",StringUtils.isNotBlank(reportDTO.getIp()) ? reportDTO.getIp() : "");
        params.put("user_agent",StringUtils.isNotBlank(reportDTO.getUser_agent()) ? URLUtil.encode(reportDTO.getUser_agent()) : "");
        params.put("srequest_id", reportDTO.getBizRequestId());
        String callbackUrl=String.format(accountDTO.getDspCallbackUrl(),reportDTO.getBizRequestId());
        String urlParams= URLUtil.buildQuery(params, StandardCharsets.UTF_8)+"&callback="+URLEncoderDecoderTool.encodeURL(callbackUrl);
        return accountDTO.getDspReportUrl()+"&"+urlParams;
    }
}
